<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.46">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #a70000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica; min-height: 22.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0000bf}
span.s1 {color: #0000bf}
span.s2 {color: #007300}
span.s3 {color: #000000}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1">//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://www.informatics.sussex.ac.uk/users/nc81/</p>
<p class="p2"><br></p>
<p class="p3"><b>NTube<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>physical modeling simulation; N tubes</b></p>
<p class="p2"><br></p>
<p class="p4"><b>NTube.ar(input=0, lossarray=0.95, karray, delaylengtharray,<span class="Apple-converted-space">  </span>mul = 1.0, add = 0.0)</b></p>
<p class="p5"><br></p>
<p class="p4">Physical model; N tube sections with N-1 scattering junctions inbetween; relative areas determine k for each junction, where each junction has its own associated k. Delay lengths can be fractional and varied on the fly. Each junction also has an associated loss, as well as for the two outer feedback connections, giving N+1 loss factors. <span class="Apple-converted-space"> </span></p>
<p class="p5"><br></p>
<p class="p4">Note: this UGen does not support multichannel expansion, due to the use of references. <span class="Apple-converted-space"> </span></p>
<p class="p5"><br></p>
<p class="p4">All arrays passed in should be marked with reference symbols.<span class="Apple-converted-space"> </span></p>
<p class="p5"><br></p>
<p class="p4"><b>input</b>- Excitation to inject into the system</p>
<p class="p4"><b>lossarray</b>-<span class="Apple-converted-space">  </span>Amplitude loss factors in circulation, N+1 of them. If a single number rather than an array is given, the UGen uses this same loss factor duplicated N+1 times.<span class="Apple-converted-space"> </span></p>
<p class="p4"><b>karray</b>- N-1 scattering coefficient for junctions of adjacent tubes, usually -1&lt;=k&lt;=1</p>
<p class="p4"><b>delaylengtharray</b>- Length in seconds of each tube's paired delay line (i.e., each waveguide section, N of them). There must be at least 2 samples per length at the synthesis sampling rate.<span class="Apple-converted-space"> </span></p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p7"><br></p>
<p class="p8">{(<span class="s1">NTube</span>.ar(<span class="s1">WhiteNoise</span>.ar, 0.97,`[0.5,-0.7],`[0.01,0.02,0.01])*0.1).dup}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//can get it sound like respiration!<span class="Apple-converted-space"> </span></p>
<p class="p8">{(<span class="s1">NTube</span>.ar(<span class="s1">WhiteNoise</span>.ar*<span class="s1">SinOsc</span>.ar(0.5),`[0.97,1.0,1.0,1.0,0.97],`[0.5,<span class="s1">MouseY</span>.kr(-1.0,1.0),0.2],`([0.01,0.02,0.01,0.005]*<span class="s1">MouseX</span>.kr(0.01,1.0)))*0.1).dup}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p8">{(<span class="s1">NTube</span>.ar(<span class="s1">PinkNoise</span>.ar*<span class="s1">SinOsc</span>.ar(0.25),`[0.97,1.0,1.0,1.0,1.0,0.97],`[0.5,<span class="s1">MouseY</span>.kr(-1.0,1.0),0.2,-0.4],`([0.01,0.02,0.01,0.005,0.05]*<span class="s1">MouseX</span>.kr(0.001,1.0,<span class="s2">'exponential'</span>)))*0.1).dup}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//tap on microphone in 16 beat and move mouse around...<span class="Apple-converted-space"> </span></p>
<p class="p8">{(<span class="s1">NTube</span>.ar(<span class="s1">SoundIn</span>.ar,`[0.97,1.0,1.0,1.0,1.0,0.97],`[0.5,<span class="s1">MouseY</span>.kr(-1.0,1.0),0.2,-0.4],`([0.01,0.02,0.01,0.005,0.05]*<span class="s1">MouseX</span>.kr(0.001,1.0,<span class="s2">'exponential'</span>)))*0.5).dup}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//delays; why stereo? warning: quite piercing</p>
<p class="p8">{(<span class="s1">NTube</span>.ar(<span class="s1">Impulse</span>.ar(<span class="s1">MouseX</span>.kr(16,1600))*<span class="s1">MouseY</span>.kr(0.0,1.0),`(<span class="s1">Array</span>.rand(11,0.95,0.99)),`(<span class="s1">Array</span>.series(9,0.8,-0.1)),`(<span class="s1">Array</span>.rand(10,0.01,0.05)) )*0.025).dup}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//can end up doing a huge amount of recirculation warning: quite piercing</p>
<p class="p8">{<span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(<span class="s1">Impulse</span>.ar([<span class="s1">MouseX</span>.kr(16,1600), <span class="s1">MouseX</span>.kr(17,2700)])*<span class="s1">MouseY</span>.kr(0.0,1.0),`([0.87]++(0.99.dup(9))++[0.87]),`(<span class="s1">Array</span>.rand(9,0.8,1.0)),`(<span class="s1">Array</span>.fill(10,{0.01})) )*0.1,0.9,0.01)*0.1}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//can end up doing a huge amount of recirculation<span class="Apple-converted-space"> </span></p>
<p class="p8">{((<span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(<span class="s1">Impulse</span>.ar(440)*<span class="s1">MouseX</span>.kr(0.0,1.0),<span class="s1">MouseY</span>.kr(0.0,0.99),`(<span class="s1">Array</span>.rand(99,0.0,1.0)),`(<span class="s1">Array</span>.rand(100,0.0001,0.01)) ),0.99,0.01).min(1.0).max(-1.0))*0.1).dup(2)}.play</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//dynamic changing of loss factors is great</p>
<p class="p8">(</p>
<p class="p8">{</p>
<p class="p8"><span class="s1">var</span> my= <span class="s1">MouseY</span>.kr(0.0,0.99);</p>
<p class="p7"><br></p>
<p class="p8"><span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(<span class="s1">PinkNoise</span>.ar*<span class="s1">EnvGen</span>.ar(<span class="s1">Env</span>.perc(0.01,0.05),<span class="s1">MouseX</span>.kr(0.0,1.0)&gt;0.5),my,`(<span class="s1">Array</span>.rand(49,0.0,1.0)),`(<span class="s1">Array</span>.rand(50,0.0001,0.01)) ),0.99,0.01).min(1.0).max(-1.0)</p>
<p class="p8">}.play</p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//1-D vocal tract model: data for Ah sound for cross-sectional areas of vocal tract (see http://www-users.york.ac.uk/~dtm3/vocaltract.html and associated publications)</p>
<p class="p9">//a=FileReader.read("/Users/nickcollins/Desktop/VowelAreaFunctions/MRI/JASAPaper/A-bart.txt");<span class="Apple-converted-space"> </span></p>
<p class="p9">//</p>
<p class="p9">//b= Array.fill(a.size.div(2),{|i| a[2*i][0]});<span class="Apple-converted-space"> </span></p>
<p class="p9">//b.size</p>
<p class="p9">//c= b[0..43].asFloat</p>
<p class="p7"><br></p>
<p class="p9">//run at higher sampling rate?<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">(</p>
<p class="p8"><span class="s1">var</span> areassource= [ 0.45, 0.2, 0.26, 0.21, 0.32, 0.3, 0.33, 1.05, 1.12, 0.85, 0.63, 0.39, 0.26, 0.28, 0.23, 0.32, 0.29, 0.28, 0.4, 0.66, 1.2, 1.05, 1.62, 2.09, 2.56, 2.78, 2.86, 3.02, 3.75, 4.6, 5.09, 6.02, 6.55, 6.29, 6.27, 5.94, 5.28, 4.7, 3.87, 4.13, 4.25, 4.27, 4.69, 5.03 ];</p>
<p class="p8"><span class="s1">var</span> areas;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> loss, karray, delayarray;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//convert to sequence of k<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//average length of human male vocal tract 16.9cm (14.1cm adult female)<span class="Apple-converted-space">  </span>speed of sound 340.29 m/s. So delay of vocal tract is<span class="Apple-converted-space"> </span></p>
<p class="p9">//0.169/340.29 = 0.00049663522289812 seconds</p>
<p class="p9">//0.0005*44100 is about 22 samples, so less than one sample per section of the throat if more than 22 measurements used!<span class="Apple-converted-space"> </span></p>
<p class="p9">//need higher sampling rate, or less sections in model</p>
<p class="p7"><br></p>
<p class="p9">//Loy p347, p358, Kelly Lochbaum junctions used in TubeN</p>
<p class="p9">//k= (Z1-Z0)/(Z1+Z0); //Z inversely proportional to A<span class="Apple-converted-space"> </span></p>
<p class="p9">//k= ((A0-A1)/(A0A1))/((A0+A1)/(A0A1)) ie similar relation for Z<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//take every 4th</p>
<p class="p8">areas= <span class="s1">Array</span>.fill(11,{<span class="s1">|i|</span> areassource[4*i]});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//about 2 samples delay for each section!<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">loss=0.99;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">karray= <span class="s1">Array</span>.fill(10,{<span class="s1">|i|</span> (areas[i]-areas[i+1])/(areas[i]+areas[i+1])});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//delayarray= Array.fill(11,{0.00049663522289812/11.0});<span class="Apple-converted-space"> </span></p>
<p class="p9"><span class="s3">delayarray= </span><span class="s1">Array</span><span class="s3">.fill(11,{0.000046}); </span>//any smaller and Nyquist problems arise...<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p9">//Impulse too predictable, need a richer low pass filtered and frequency modulated glottal oscillation<span class="Apple-converted-space"> </span></p>
<p class="p9">//Dust.ar(MouseX.kr(100,400),0.9,0.1*PinkNoise.ar)</p>
<p class="p8">{</p>
<p class="p8"><span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(<span class="s1">PinkNoise</span>.ar(0.3),loss, `karray, `delayarray , 0.5),0.99,0.01).min(1.0).max(-1.0)</p>
<p class="p8">}.play</p>
<p class="p7"><br></p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//Next patch only works properly at sampling rate of 192kHz!<span class="Apple-converted-space"> </span></p>
<p class="p8">(</p>
<p class="p8"><span class="s1">var</span> areassource= [ 0.45, 0.2, 0.26, 0.21, 0.32, 0.3, 0.33, 1.05, 1.12, 0.85, 0.63, 0.39, 0.26, 0.28, 0.23, 0.32, 0.29, 0.28, 0.4, 0.66, 1.2, 1.05, 1.62, 2.09, 2.56, 2.78, 2.86, 3.02, 3.75, 4.6, 5.09, 6.02, 6.55, 6.29, 6.27, 5.94, 5.28, 4.7, 3.87, 4.13, 4.25, 4.27, 4.69, 5.03 ];</p>
<p class="p8"><span class="s1">var</span> areas;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> loss, karray, delayarray;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">areas= <span class="s1">Array</span>.fill(44,{<span class="s1">|i|</span> areassource[i]});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">loss=0.99;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">karray= <span class="s1">Array</span>.fill(43,{<span class="s1">|i|</span> (areas[i]-areas[i+1])/(areas[i]+areas[i+1])});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">delayarray= <span class="s1">Array</span>.fill(44,{0.00049663522289812/44.0});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">{</p>
<p class="p8"><span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(<span class="s1">Decay</span>.ar(<span class="s1">Impulse</span>.ar(<span class="s1">MouseX</span>.kr(10,200)+<span class="s1">LFNoise1</span>.kr(7,4),0.0,0.5),<span class="s1">MouseY</span>.kr(0.01,0.2)),loss, `karray, `delayarray , 0.5),0.99,0.01).min(1.0).max(-1.0)</p>
<p class="p8">}.play</p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//loud hammering</p>
<p class="p8">(</p>
<p class="p8">{</p>
<p class="p8"><span class="s1">var</span> delays, source, loss, k;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> trigger;</p>
<p class="p8">trigger= <span class="s1">Impulse</span>.kr(<span class="s1">MouseY</span>.kr(1,10));</p>
<p class="p7"><br></p>
<p class="p8">loss=`(<span class="s1">Array</span>.fill(7,{<span class="s1">EnvGen</span>.ar(<span class="s1">Env</span>([rrand(0.95,1.0),rrand(0.95,1.0),rrand(0.5,0.9),rrand(0.0,0.1)],[0.1,rrand(0.05,0.5),rrand(0.05,0.5)]),trigger)}));<span class="Apple-converted-space"> </span></p>
<p class="p8">k= `(<span class="s1">Array</span>.fill(5,{rrand(0.7,1.0)}));</p>
<p class="p8">delays=`(<span class="s1">Array</span>.fill(6,{exprand(0.01,0.2)}));<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">delays.value.sum.postln;</p>
<p class="p7"><br></p>
<p class="p8">source= <span class="s1">WhiteNoise</span>.ar(0.5)*<span class="s1">EnvGen</span>.ar(<span class="s1">Env</span>([1,1,0],[delays.value.sum,0.0]), trigger);</p>
<p class="p7"><br></p>
<p class="p8"><span class="s1">Out</span>.ar(0,<span class="s1">Pan2</span>.ar(<span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(source,loss, k, delays),0.99,0.01).min(1.0).max(-1.0),0.0));<span class="Apple-converted-space"> </span></p>
<p class="p8">}.play</p>
<p class="p7"><br></p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p9">//could be piercing if sine frequencies put higher, also potentially high CPU cost, be careful<span class="Apple-converted-space"> </span></p>
<p class="p8">(</p>
<p class="p8"><span class="s1">var</span> n=7;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p10">SynthDef<span class="s3">(</span><span class="s2">\ntubefx</span><span class="s3">,{</span>|out=0|</p>
<p class="p7"><br></p>
<p class="p8"><span class="s1">ReplaceOut</span>.ar(out, <span class="s1">Limiter</span>.ar(<span class="s1">In</span>.ar(0,2),0.99,0.01))</p>
<p class="p8">}).send(s);<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p10">SynthDef<span class="s3">(</span><span class="s2">\ntubehelp</span><span class="s3">,{</span>|out=0, dur=0.5, pan=0.0, amp=0.1, lagtime=0.1, freq=440|</p>
<p class="p8"><span class="s1">var</span> env;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> lossarray, karray, delaylengtharray;<span class="Apple-converted-space"> </span></p>
<p class="p9">//Decay2.ar(Impulse.ar(freq),lagtime,0.01)</p>
<p class="p8"><span class="s1">var</span> source= <span class="s1">SinOsc</span>.ar(freq)*(0.95+(<span class="s1">Line</span>.kr(0,1,0.2)*0.05*<span class="s1">BrownNoise</span>.ar));<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">env= <span class="s1">EnvGen</span>.ar(<span class="s1">Env</span>([0,1,0.8,0.8,0],[0.01,0.01,dur,0.5]),doneAction:2);<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">lossarray = <span class="s1">Control</span>.names([<span class="s2">\lossarray</span>]).ir(<span class="s1">Array</span>.rand(n+1, 0.8,0.99));</p>
<p class="p8">karray= <span class="s1">Control</span>.names([<span class="s2">\karray</span>]).ir(<span class="s1">Array</span>.rand(n-1, -0.5,0.5));</p>
<p class="p8">delaylengtharray= <span class="s1">Control</span>.names([<span class="s2">\delaylengtharray</span>]).ir(<span class="s1">Array</span>.rand(n, 0.01,0.05));</p>
<p class="p7"><span class="Apple-tab-span">	</span></p>
<p class="p8"><span class="s1">Out</span>.ar(out,<span class="s1">Pan2</span>.ar(<span class="s1">LeakDC</span>.ar(env*<span class="s1">Limiter</span>.ar(<span class="s1">NTube</span>.ar(amp*source,`lossarray, `karray, `delaylengtharray),0.99,0.01).min(1.0).max(-1.0)),pan));<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">}).send(s);<span class="Apple-converted-space"> </span></p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p8">(</p>
<p class="p8"><span class="s1">var</span> n=7;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> group= <span class="s1">Group</span>.basicNew(s,1);<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">t.stop;</p>
<p class="p8">t={</p>
<p class="p8"><span class="s1">var</span> durs;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> inverted;<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> range= rrand(0.1,1.0);<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> minloss= rrand(0.7,0.98);</p>
<p class="p8"><span class="s1">var</span> maxloss= (minloss+rrand(0.0,0.1)).min(0.99);<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> maxdur= rrand(0.001,0.05);<span class="Apple-converted-space"> </span></p>
<p class="p8"><span class="s1">var</span> fx= <span class="s1">Synth</span>.tail(group,<span class="s2">\ntubefx</span>);<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">durs= [0.01,0.1,0.2,0.5,1.0];<span class="Apple-converted-space"> </span></p>
<p class="p8">inverted= durs.reverse.normalizeSum;<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8"><span class="s1">inf</span>.do{</p>
<p class="p7"><br></p>
<p class="p8">if(0.1.coin) {range= rrand(0.1,1.0);};<span class="Apple-converted-space"> </span></p>
<p class="p8">if(0.07.coin) {minloss= rrand(0.8,0.98); maxloss= (minloss+rrand(0.0,0.1)).min(0.99);};<span class="Apple-converted-space"> </span></p>
<p class="p8">if(0.05.coin) {maxdur=exprand(0.0025,0.05)};<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p8">a= <span class="s1">Synth</span>.head(group,<span class="s2">\ntubehelp</span>,[<span class="s2">\dur</span>, rrand(0.1,3.0), <span class="s2">\freq</span>, exprand(1,1000).round(30.0)+(3.rand2),<span class="s2">\lagtime</span>, rrand(0.001,0.1), <span class="s2">\pan</span>, rrand(-0.5,0.5), <span class="s2">\amp</span>, exprand(0.01,0.3), <span class="s2">\lossarray</span>, <span class="s1">Array</span>.rand(n+1, minloss,maxloss), <span class="s2">\karray</span>, <span class="s1">Array</span>.rand(n-1,range.neg,range), <span class="s2">\delaylengtharray</span>, <span class="s1">Array</span>.rand(n, 0.001, maxdur)]);</p>
<p class="p7"><br></p>
<p class="p9">//</p>
<p class="p9">//s.bind({</p>
<p class="p9">//a.set(\freq, exprand(1,4000),\lagtime, rrand(0.001,0.1), \pan, rrand(-0.1,0.1), \amp, exprand(0.01,0.5));</p>
<p class="p9">//a.setn(\lossarray, Array.rand(n+1, minloss,maxloss));</p>
<p class="p9">//a.setn(\karray, Array.rand(n-1,range.neg,range));</p>
<p class="p9">//a.setn(\delaylengtharray, Array.rand(n, 0.001, maxdur));</p>
<p class="p9">//});<span class="Apple-converted-space"> </span></p>
<p class="p7"><br></p>
<p class="p7"><br></p>
<p class="p8">durs.wchoose(inverted).wait;</p>
<p class="p8">};</p>
<p class="p7"><br></p>
<p class="p8">}.fork;</p>
<p class="p8">)</p>
<p class="p7"><br></p>
<p class="p6"><br></p>
<p class="p6"><br></p>
</body>
</html>
